package com.topisv.tms.entity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.ToStringBuilder;

@Entity
@Table(name = "tbl_role_permission")
public class Roleperm extends IdEntity {
	
	private Role role;
	
	private Permission permission;

	public Roleperm() {
	}

	public Roleperm(Long id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name = "role_id")
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}
	@ManyToOne
	@JoinColumn(name = "permission_id")
	public Permission getPermission() {
		return permission;
	}

	public void setPermission(Permission permission) {
		this.permission = permission;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}